<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Template</title>
</head>
<body>
    <h1>条件类Action</h1>
    {{ if .rand }}
    Number is grater than five
    {{ else }}
    Number is less than five
    {{ end }}
    <hr>
    <h1>遍历类Action</h1>
    <ul>
        {{ range .names }}
        <li>{{ . }}</li>
        {{ else }}
        <li>no more name</li>
        {{ end }}
    </ul>
    <hr>
    <h1>遍历类Action-回落机制</h1>
    <ul>
        {{ range .emptyNames }}
        <li>{{ . }}</li>
        {{ else }}
        <li>empty names</li>
        {{ end }}
    </ul>

    <hr>
    <h1>设置类Action-with</h1>
    {{ with .rand }}
    <p>{{ . }}</p>
    {{ end }}

    <div style="background-color: #bfa">
    <h1>包含类Action</h1>
    <p>包含类Action要求包含的模板一定是解析过的才能包含</p>
    {{ template "t1.html" .names }}
    </div>

    <h1>测试自定义函数</h1>
    {{ .now | fDate }}
</body>
</html>